package com.example.imiaow.yyads_text.banner;

import android.app.Activity;
import android.content.Context;

import java.util.Map;

import io.flutter.Log;
import io.flutter.plugin.common.BinaryMessenger;
import io.flutter.plugin.common.MessageCodec;
import io.flutter.plugin.common.StandardMessageCodec;
import io.flutter.plugin.platform.PlatformView;
import io.flutter.plugin.platform.PlatformViewFactory;

public class BannerFactor extends PlatformViewFactory {
    private final BinaryMessenger mbinaryMessenger;
    private final Activity mactivity;

    public BannerFactor(BinaryMessenger binaryMessenger, Activity activity) {
        super(StandardMessageCodec.INSTANCE);
        this.mbinaryMessenger = binaryMessenger;
        this.mactivity = activity;
    }

    @Override
    public PlatformView create(Context context, int viewId, Object args) {
        Map<String,Object> params = (Map<String, Object>) args;
        Banner banner = new Banner(context,mactivity,mbinaryMessenger,viewId,params);
        banner.init();
        return banner;
    }
}
